﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;
using EfConsole.Entities;
using Microsoft.EntityFrameworkCore;

namespace EfConsole
{
    public class TestContext : DbContext
    {
        private readonly string conn;

        public TestContext()
        {
            var cb = new SqlConnectionStringBuilder
            {
                DataSource = "192.168.3.30",
                InitialCatalog = "cop-test-back",
                UserID = "sa",
                Password = "1qaz2wsxE"
            };

            conn = cb.ConnectionString;
        }

        public TestContext(string conn)
        {
            this.conn = conn;
        }
        public DbSet<ProfileEntity> Profiles { get; set; }

        


        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {

          

            optionsBuilder.UseSqlServer(conn);
        }
    }
}
